/* ----------------------------------------------------------------------------
* File: dictionary_impl.h
*
* Desc: Implementation for dictionary
*
* Created: 07/05/2011, by Alexey Korshunov
* ---------------------------------------------------------------------------- */
#ifndef _DICTIONARY_IMPL_H_
#define _DICTIONARY_IMPL_H_

#include "dictionary.h"
#include "exception.h"
#include <vector>
#include <fstream>
#include <iostream>


namespace ModuleManagement
{
	class DictionaryImpl : public Dictionary
	{
		typedef struct QuestionPair
		{
			std::string question;
			std::string answer;
		}QuestionPair;

		typedef std::vector<QuestionPair*>				VectorQuestions;
		typedef std::vector<QuestionPair*>::iterator	VectorQuestionsIterator;

	public:
		explicit DictionaryImpl(const std::string& FileName) throw(Common::Exception);
		~DictionaryImpl();

		virtual unsigned int GetCountQuestions();
		virtual void SetCurNumberQuestion(unsigned int Num);
		virtual const std::string& GetQuestion();
		virtual const std::string& GetAnswer();

	private:
		VectorQuestions m_Questions;
		std::string m_Answer;
		unsigned int m_QuestionId;
	};
}

#endif // _DICTIONARY_IMPL_H_
